<!DOCTYPE html>
<html>
<head>
    <meta name="layout" content="main"/>
    <g:set var="entityName" />
    <title>押品搜索</title>
    <style>
    .table>tbody>tr>td{
        vertical-align: middle;
    }
    </style>
</head>

<body class="fixed-navbar fixed-sidebar">
<div class="small-header">
    <div class="hpanel">
        <div class="panel-body">
            <div id="hbreadcrumb" class="pull-right">
                <ol class="hbreadcrumb breadcrumb">
                    <li>CINDATA PLS</li>
                    <li class="active">
                        <span>押品搜索</span>
                    </li>
                </ol>
            </div>

            <h2 class="font-light m-b-xs">
                押品搜索
            </h2>
        </div>
    </div>
</div>
<div class="content animate-panel">
    <div class="row">
        <g:form method="POST" action="index" class="form-horizontal" role="form">
        <div class="hpanel hblue">
            <div class="panel-heading">
                 <div class="panel-tools">
                    <button class="btn btn-primary btn-xs" type="submit"><i class="fa fa-search"></i>查询</button>
                    <button class="btn btn-warning2 btn-xs" type="button" id="resetBtn">
                        <i class="fa fa-times"></i>重置</button>
                </div>
                查询
            </div>
                <div class="panel-body seach-group">
                 <div class="form-group col-md-4">
                        <label for="district" class="col-sm-3 control-label">押品地址</label>
                        <div class="col-sm-9">
                            <input type="text" class="form-control"  id="sourceAddress" name="sourceAddress" value="${params?.sourceAddress}" placeholder="请输入押品地址">
                        </div>
                    </div>
            <div class="form-group col-md-4">
                <label class="col-md-3 control-label">押品状态</label>
                <div class="col-md-9">
                    <g:select  class="form-control m-b" name="status" from="${com.cindata.dictionary.EstateStatusDict.list()}" id="status" optionKey="id" optionValue="name" value="${params?.status}" noSelection="${['':'请选择押品状态']}"></g:select>
                </div>
                </div>
            <div class="col-sm-9" style="display: none">
                <input type="text" class="form-control"  id="batch" name="batch" value="${params?.batch}">
            </div>
            </g:form>
        </div>
    </div>
    <div class="hpanel hgreen">
            <div class="panel-heading">
                全部押品
            </div>
            <div class="panel-body no-padding">
                <div class="table-responsive">
                    <table cellpadding="1" cellspacing="1" class="table table-striped table-bordered table-hover text-center">
                        <thead>
                        <tr>
                            <g:sortableColumn property="id" title="押品编号"  class="text-center" params="${params}"/>
                            <g:sortableColumn property="evaluateStatue.name" title="评估状态"  class="text-center" params="${params}"/>
                            <g:sortableColumn property="estateStatus.name" title="押品状态"  class="text-center" params="${params}"/>
                            <g:sortableColumn property="cityName" title="城市"  class="text-center" params="${params}"/>
                            <g:sortableColumn property="districtName" title="行政区"  class="text-center" params="${params}"/>
                            <g:sortableColumn property="address" title="地址"  class="text-center" params="${params}"/>
                            <g:sortableColumn property="buildArea" title="面积(平米)"  class="text-center" params="${params}"/>
                            <g:sortableColumn property="totalFloor" title="总楼层"  class="text-center"params="${params}"/>
                            <g:sortableColumn property="currentFloor" title="当前层"  class="text-center" params="${params}"/>
                            <g:sortableColumn property="modifiedDate" title="最新登记日期"  class="text-center" params="${params}"/>
                            <g:sortableColumn property="totalPrice" title="最新评估价值"  class="text-center" params="${params}"/>
                            <g:sortableColumn property="evaluateDate" title="最新评估日期"  class="text-center" params="${params}"/>
                            <g:sortableColumn property="latestEvaluateAccount" title="评估机构"  class="text-center" params="${params}"/>
                        </tr>
                        </thead>
                        <tbody>
                        <g:each in="${batchEstateList}">
                            <tr class="text-center">
                                <td >${it?.estate?.externalId}</td>
                                <td>${it?.evaluateStatue?.name}</td>
                                <td>${it?.estate?.estateStatus?.name}</td>
                                <td>${it?.estate?.city?.name}</td>
                                <td>${it?.estate?.district?.name}</td>
                                <td>${it?.estate?.sourceAddress}</td>
                                <td>${it?.estate?.buildArea}</td>
                                <td>${it?.estate?.sourceTotalFloor}</td>
                                <td>${it?.estate?.sourceCurrentFloor}</td>
                                <td><g:formatDate date="${it?.estate?.modifiedDate}" format="yyyy-MM-dd "></g:formatDate></td>
                                <td>${it?.estate?.totalPrice?it?.estate?.totalPrice:'-'}</td>
                                <td><g:if test="${it?.estate?.valuationDate}"><g:formatDate date="${it?.estate?.valuationDate}" format="yyyy-MM-dd "></g:formatDate></g:if><g:else>-</g:else></td>
                                <td>${it?.estate?.latestEvaluateAccount?it?.estate?.latestEvaluateAccount:'-'}</td>
                            </tr>
                        </g:each>
                        </tbody>
                    </table>
                </div>
            </div>
            <div class="panel-footer">
                <div class="pagination">
                    <g:paginate total="${batchEstateCount ?: 0}" params="${params}"/>
                </div>
            </div>
    </div>
    <div class="modal fade hmodal-warning" id="myModal7" tabindex="-1" role="dialog" aria-hidden="true">
        <div class="modal-dialog">
            <g:form controller="estateImport" action="excelImport" method="post" enctype="multipart/form-data">
                <div class="modal-content">
                    <div class="modal-body dataModal">
                        <div class="form-group">
                            <label class="col-md-3 control-label lineLab">批次名</label>

                            <div class="col-md-9"><input type="text" id="batch" name="batch" placeholder="请输入批次名"
                                                         class="form-control"></div>
                        </div>

                        <div class="form-group col-md-12">
                            <label class="col-md-3 control-label lineLab">处理状态</label>

                            <div class="col-md-9">
                                <select class="form-control m-b" name="status" id="status">
                                    <option>请选择处理状态</option>
                                    <option>等待处理</option>
                                    <option>处理完成</option>
                                </select>
                            </div>
                        </div>

                        <div class="form-group col-md-9 col-md-offset-3">
                            <a href='javascript:void(0);' class="blueButton">选择文件</a>
                            <input type="file" name="myFile" id="myFile" class="myFileUpload"/>
                        </div>
                    </div>

                    <div class="modal-footer">
                        <a href="download/templet.xls" style="font-weight:bold;text-decoration:none;color:#fff;" download>
                            <button type="button" class="btn btn-default">
                                导入模板下载
                            </button>
                        </a>
                        <button class="btn btn-default dataImport">
                            <input type="submit" value="导入">
                        </button>
                        <button class=" btn cancel" tabindex="2" style="display: inline-block; box-shadow: none;"
                                data-dismiss="modal">关闭</button>
                    </div>
                </div>
            </g:form>
        </div>
    </div>
</div>
<g:javascript>
    $(function () {
        $("#resetBtn").click(function () {
            $("#sourceAddress").val("");
            $("#s2id_status span:first").html("请选择押品状态");
            $("#status").val("");
        })
    })
</g:javascript>

</body>
</html>
